package com.clstu.map;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapSource {
    public static void main(String[] args) {
        HashMap map = new HashMap();//双列集合map
        map.put("no1","jackC");
        map.put("no2","jackC");

        Set set=map.entrySet();
        System.out.println(set.getClass());//HashMap$EntrySet
        for (Object o :set
             ) {
            //System.out.println(o.getClass());//HashMap$Node
            //System.out.println(o);
            Map.Entry entry = (Map.Entry) o;
            System.out.println(entry.getKey()+"-"+entry.getValue());
        }
        Set set1 = map.keySet();//单列集合。set
        Collection values = map.values();//单列集合。
        System.out.println(set1.getClass());
        System.out.println(values.getClass());
    }
}
